package com.hean.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class ParamsTransimt extends Activity {
	TextView textView;
	Button button;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.paramsbetweenactivity);
		Intent intent = this.getIntent();
		int id = intent.getIntExtra("id", 0);
		String name=intent.getStringExtra("name");
		textView=(TextView) findViewById(R.id.paramstransimt_tv);
		textView.setText("id="+id+";name="+name);
		button=(Button) findViewById(R.id.paramsclose);
		
		button.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.putExtra("result", "result is ok");
				setResult(RESULT_OK,intent);//第一个参数可以自己设
				finish();//明确关闭当前的activity，此方法调用可以增加一个按键；不调用则由操作系统来关闭
			}
		});
	}
}
